#ifndef STLRENDER_H
#define STLRENDER_H

#include <QMainWindow>
#include <QTimer>
#include "Robot.h"
#include "src/globalvar.h"
#include "ui/hardwaretestdialog.h"
#include "ui/adjustsimdialog.h"
#include "src/qserialproto.h"
#include "src/globalvar.h"
#include <QTimer>

namespace Ui {
class stlrender;
class AdjustSimDialog;
}

class stlrender : public QMainWindow
{
    Q_OBJECT
public slots:
    void OnSerialData(ProtoData);
public:
    explicit stlrender(QWidget *parent = nullptr);
    ~stlrender();
private slots:
    void go();
    void on_pushButton_clicked();
    void on_pushButton_2_clicked();
    void on_pushButton_4_clicked();
    void on_pushButton_3_clicked();

    void on_pushButton_5_clicked();
    void timerout();
private:
    float theta1;
    float theta2;
    float theta3;
    float theta4;
    float theta5;
    float theta6;

    Robot::Robot mRobot;

    Robot::Link mLink1;
    Robot::Link mLink2;
    Robot::Link mLink3;
    Robot::Link mLink4;
    Robot::Link mLink5;
    Robot::Link mLink6;

    QTimer mTimerUpdate;
    clock_t mClock;
    double mPassTime, dt;
    Ui::stlrender *ui;
    HardwareTestDialog *mTestDriverDialog = new HardwareTestDialog;
    AdjustSimDialog *mAdjustDiag = new AdjustSimDialog;
    QTimer mTimer;
    void _updateJointStatus();

};

#endif // STLRENDER_H
